<template>
	<view>
		<view class="search">
			<search></search>
		</view>
		
		<view class="tabbar">
			<me-tabs v-model="tabIndex" :tabs="tabs" @change="tabChange" :height="100" :tabWidth="180" ></me-tabs>
		</view>
		
		<view v-if="cateshow" style="width: 100vw;overflow: hidden;">
		<!--今日精选-->
		<swiper autoplay="true" indicator-dots="true" class="swipers">
			<swiper-item>
				<image src="/static/image/banner1.png" mode="aspectFill"></image>
			</swiper-item>
			<swiper-item>
				<image src="/static/image/banner2.png" mode="aspectFill"></image>
			</swiper-item>
		</swiper>
		<view class="notice">
			咨询请联系客服，微信号：99999wx
		</view>
		<view class="appicon">
			<view class="iconitem" v-for="(item,index) in appicon" :key="index">
				<view class="img"></view>
				<view class="text">天猫超市</view>
			</view>
		</view>
		<!--热门活动-->
		<view class="huod">
			<view class="tip">热门活动</view>
			<image src="/static/image/huod.png" mode="aspectFill"></image>
		</view>
		<!--边看边买-->
		<scroll-view scroll-x="true" class="buy">
			<view class="tip">边看边买</view>
			<view class="buyitem" v-for="(item,index) in buydata" :key="index">
				<image src="/static/image/goodsimg.png" mode="aspectFill"></image>
				<text class="shoptitle">男装阿散井打开就看见就爱上是交互好菊花哥就交互就</text>
				<view class="money">
					<view class="price">￥ 480元<text>券后价</text></view>
					<view class="qiang">已抢1233件</view>
				</view>
			</view>
		</scroll-view>
		
		<!--优惠直播-->
		<view class="listdata">
			<view class="tip">优惠直播</view>
			<view class="list-item" v-for="(item,index) in goodsdata" :key="index">
				<view class="cell-left">
					<image src="/static/image/goodsimg.png" mode="aspectFill"></image>
					<view></view>
				</view>
				<view class="cell-right">
					<view class="shoptitle">
						<!-- <image src="/static/image/tm.png" mode="aspectFill"></image>
						<view class="excpt">运费险</view> -->
						<view class="textinfo">衬衫啊较深的客户客户说的看看看很快很快打开打开</view> 
					</view>
					<view class="shopdesc">新款男版休闲系列套装</view>
					<view class="shopprice">
						<view class="price">￥ 480元<text style="margin-left: 10rpx;">券后价</text></view>
						<view class="rob">已抢125451件</view>
					</view>
					<view class="shoptip">
						<view class="tipone">减100元券</view>
						<view class="tiptwo">返利：4.12</view>
					</view>
				</view>
			</view>
		</view>
		</view>
		<!--分类信息-->
		<view v-else>
		<view class="cate" >
		 	<view class="item" v-for="(item,index) in cate" :key="index">
				<image src="/static/image/goods.png" mode="aspectFill"></image>
				<view>衬衫</view>
			</view>
		</view>
		
		<view class="listbar">
			<me-tabs v-model="lsit_tabIndex" :tabs="list_tabs" @change="list_tabChange" :height="100" seletedcolor="#e93340" :key="index"></me-tabs>
		</view>
		
		<view class="listdata">
			<view class="list-item" v-for="(item,index) in goodsdata" :key="index">
				<view class="cell-left">
					<image src="/static/image/goodsimg.png" mode="aspectFill"></image>
					<view></view>
				</view>
				<view class="cell-right">
					<view class="shoptitle">
						<!-- <image src="/static/image/tm.png" mode="aspectFill"></image>
						<view class="excpt">运费险</view> -->
						<view class="textinfo">衬衫啊较深的客户客户说的看看看很快很快打开打开</view> 
					</view>
					<view class="shopdesc">新款男版休闲系列套装</view>
					<view class="shopprice">
						<view class="price">￥ 480元<text style="margin-left: 10rpx;">券后价</text></view>
						<view class="rob">已抢125451件</view>
					</view>
					<view class="shoptip">
						<view class="tipone">减100元券</view>
						<view class="tiptwo">返利：4.12</view>
					</view>
				</view>
			</view>
		</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				buydata:10,
				appicon:5,
				cateshow:true,
				goodsdata:20,
				cate:8,
				tabIndex: 0, // 当前菜单下标
				tabs: ['今日精选', '男装', '女装', '母婴', '居家', '配饰', '美食', '箱包'],
				lsit_tabIndex:0,
				list_tabs:['综合','最新','劵额','销量','价格']
			}
		},
		onLoad() {

		},
		methods: {
			tabChange(e) {
				console.log(e)
			},
			list_tabChange(e){
				console.log(e,'list')
			}
		}
	}
</script>

<style lang="scss">
	.buy{
		width: 100%;
		background-color: #fff;
		padding: 20rpx 0;
		padding-top:40rpx;
		position: relative;
		border: 1rpx solid #f0f0f0;
		white-space: nowrap;
		position: relative;
		height: 500rpx;
		margin-bottom: 30rpx;
		.tip{
			padding: 10rpx;
			font-size: 28rpx;
			top: 0;
			left: 0;
			color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			border-top-right-radius: 20rpx;
			background: linear-gradient(left,#fe679d,#fd3064);
		}
		.buyitem{
			width: 400rpx;
			display: inline-block;
			font-size: 28rpx;
			border: 1rpx solid #f8f8f8;
			margin: 10rpx;
			border-radius: 20rpx;
			.shoptitle{
				display: block;
				padding: 10rpx;
				// border: 1rpx solid #000;
				margin: 0 auto;
				white-space:normal;
				font-size: 25rpx;
			}
			.money{
				width: 90%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				color:$uni-color-main;
				font-size: 28rpx;
				margin: 10rpx auto;
				.price{
					font-weight: bold;
					display: flex;
					justify-content: center;
					align-items: center;
					text{
						font-size: 25rpx;
						margin-left: 5rpx;
					}
				}
				.qiang{
					font-size: 22rpx;
					color: #9e9e9e;
				}
				
			}
			image{
				border-top-left-radius: 20rpx;
				border-top-right-radius: 20rpx;
				width: 100%;
				height: 330rpx;
			}
		}
	}
	.huod{
		margin-bottom: 20rpx;
		width: 100%;
		background-color: #fff;
		padding: 20rpx;
		position: relative;
		image{
			width: 100%;
			height: 300rpx;
		}
		.tip{
			padding: 10rpx;
			font-size: 28rpx;
			top: 0;
			left: 0;
			color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			border-top-right-radius: 20rpx;
			background: linear-gradient(left,#fe679d,#fd3064);
		}
	}

	.appicon{
		display: flex;
		justify-content: space-around;
		align-items: center;
		background-color: #fff;
		width: 100%;
		padding: 30rpx 0;
		margin-top: 20rpx;
		.iconitem{
			font-size: 25rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			
			.img{
				width: 80rpx ;
				height: 80rpx;
				border-radius: 50%;
				background-color: #9d9e9e;
			
			}
			.text{
				margin-top: 20rpx;
				color: #333;
			}
		}
		
	}
		.swipers{
			width: 750rpx;
			height: 300rpx;
			image{
				width: 750rpx;
				height: 300rpx;
			}
		}
	.notice{
	width: 100%;
	height: 50rpx;
	background-color: #fffbe8;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	color: #f29046;
	font-size: 25rpx;
	padding-left: 20rpx;
	}
	.listdata{
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		width: 100%;
		position: relative;
		.tip{
			padding: 10rpx;
			font-size: 28rpx;
			top: -10rpx;
			left: 0;
			color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			position: absolute;
			border-top-right-radius: 20rpx;
			background: linear-gradient(left,#fe679d,#fd3064);
		}
		.list-item{
			padding: 20rpx 0;
			width: 95%;
			margin: 20rpx auto;
			background-color: #fff;
			border-radius: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.cell-left{
				display: flex;
				justify-content: center;
				align-items: center;
				image{
					width: 252rpx;
					height: 252rpx;
					border-top-left-radius: 20rpx;
				}
				
				// border: 1rpx solid #000;
			}
			.cell-right{
				width: 60%;
				margin: 0 auto;
				// border: 1rpx solid #F0AD4E;
				display: flex;
				justify-content: center;
				align-items: center;
				flex-direction: column;
				font-size: 28rpx;
				.shoptitle{
					display: flex;
					align-items: flex-start;
					justify-content: flex-start;
					width: 100%;
					position: relative;
					image{
						width: 41rpx;
						height: 34rpx;
						position: absolute;
						top: 0;
						left: 0;
					}
					.excpt{
						position: absolute;
						top: 0;
						left: 50rpx;
						width: 80rpx;
						height: 35rpx;
						font-size: 22rpx;
						padding: 0 5rpx;
						border-top-left-radius: 20rpx;
						border-bottom-right-radius: 20rpx;
						background: linear-gradient(left,#e96649,#e93440);
						display: flex;
						justify-content: center;
						align-items: center;
						color: #fff;
						font-size: 25rpx;
					}
					.textinfo{
						//margin-left:120rpx;
						display: flex;
						justify-content: flex-start;
						align-items: center;
						.zhanwei{
							//width: 200rpx;
						}
					}
				}
				.shopdesc{
					display: flex;
					justify-content: space-between;
					align-items: center;
					width: 100%;
					color: $uni-color-main;
					margin-top: 5rpx;
				}
				.shopprice{
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin: 10rpx 0;
					margin-bottom: 20rpx;
					.price{
						font-weight: bold;
						font-size: 28rpx;
						color:$uni-color-main;
						display: flex;
						justify-content: center;
						align-items: center;
						text{
							font-size: 22rpx;
						}
					}
					.rob{
						color: #9e9e9e;
						font-size: 22rpx;
					}
				}
				.shoptip{
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 25rpx;
					.tipone{
						width: 120rpx;
						height: 60rpx;
						background-color: #e39d4c;
						color: #fff;
						display: flex;
						justify-content: center;
						align-items: center;
						border-top-left-radius: 20rpx;
						border-bottom-right-radius: 20rpx;
					}
					.tiptwo{
						width: 200rpx;
						height: 60rpx;
						background-color: #e39d4c;
						color: #fff;
						display: flex;
						justify-content: center;
						align-items: center;
						border-top-left-radius: 20rpx;
						border-bottom-right-radius: 20rpx;						background: linear-gradient(left,#e96649,#e93440);
					}
				}
			}
		}
	}
	.listbar{
		background-color: #fff;
		color: #373b40;
	}
	.search{
		height: 120rpx;
		background-color: $uni-color-main;
	}
	.tabbar{
		background-color: $uni-color-main;
		color: #fff;
	}
	.cate{
		width: 100%;
		display: flex;
		justify-content:space-around;
		align-items: center;
		flex-wrap: wrap;
		background-color: #fff;
		margin-bottom: 20rpx;
		padding-bottom: 20rpx;
		.item{
			width: 180rpx;
			height: auto;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			color: #9e9e9e;
			font-size: 28rpx;
			image{
				width: 68rpx;
				height: 88rpx;
			
				margin-top: 30rpx;
				margin-bottom: 10rpx;
			}
		}
	}

</style>
